Lab 02 System Examination
System Examination involves evaluating whether a computer system or network contains what it is intended to contain and only what it is intended to contain, and is behaving according to expectations. This cannot be done without defining expectations of what it should contain and how it should behave.
Defining Expectations
Since our VM was not built by us, we would be dependant on receiving expected state documentation from whoever ran it before us. We will take the position that such documentation/policy is non-existent for our system beyond the brief description of the server we saw in Lab 1. So our examination of the system will provide our baseline documentation of the system’s current state.
Evaluating Static State
The content of a system may be divided up in any way that makes sense for your organization. For our purposes, we will ignore hardware since we are using virtual machines, and focus instead on software and data.
Software
To keep this part manageable in the time we have for the course, we will only focus on software that is installed as a package or group of packages. We will ignore manually installed software that is not managed by the APT package tools.
- What software is installed, and is it the right software?
- Identify installed software, noting non-required software
- Check for currency of installed software
- Identify security risks of installed software by checking CVEs
- Is the software’s integrity intact?
- Install debsums package
- Use the debsums command to check the binary and configuration files in the openssh-client package
- Use debsums to check if you have any packages installed without checksums
- Modify your /etc/ssh/ssh_config file in a trivial way
- Does debsums find your change when you rerun it?
- Rename your /usr/bin/scp file to /usr/bin/scp.orig
- Rerun debsums to see if it tells you about the now-missing scp program
- Rename /usr/bin/scp.orig back to /usr/bin/scp
- What configuration-oriented changes are there?
- Identify all package-installed configuration files which are no longer in their default configuration as reported by debsums
- Do you have other configuration files that have changed that debsums does not report?
- Who can use su/sudo?
Data
- Who has what kind of data on the system?
- What user accounts exist on the system?
- What file types exist in user’s files (ones not owned by system accounts)?
- Are there resource limits?
- Are there any quotas in the filesystems?
- Are there any resource (CPU/memory) limits on end-user accounts?
- Are there any “bad” files?
- Do any users have world-writable permissions on their files/directories? If so, should they?
- Do any users have excessive space usage or hidden files that you would not expect to find?
- Do any end-users own setuid or setgid files?
- Do any end-users have files that do not belong to them in their home directories or other data spaces that they own?
- Are there files owned by system accounts that were not installed as part of packages?
- Are there end-user-owned files in any of the system directories such as /, /etc, /bin, /sbin, anywhere under /usr?
- Are there dotfiles (hidden files) anywhere but in end users’ home directories?
How is awareness of this state information kept current?
State Examination Software
Install and try Lynis and AIDE for system examination and evaluation.
Evaluating Dynamic State
- Explore dynamic state tools you haven’t used before that are mentioned in the presentation on slides 9-12
- Review the contents of your /var/log/auth.log file to see what kind of log entries are in it
- Try each of the su and sudo methods of getting privileged access to the system, but use wrong passwords
- Try logging in with ssh using a wrong password
- Try logging in with ssh using an invalid username
- Review what got logged for each of the failed access attempts to become familisr with what those entries look like
Review the suggestions at https://wiki.ubuntu.com/BasicSecurity/DidIJustGetOwned.
Grading
This lab is intended to familiarize you with the basic tools used to examine any system for security-related purposes. There is nothing to hand in for this lab. The more you do with it, better positioned you will be for the remainder of the INSS program. This is purely a learning reinforcement activity.